Skip to content

Fix bug introduced by PR#167 not covering all available currencies#181

Open
thai-truong wants to merge 1 commit intoRubyMoney:mainfrom
thai-truong:feature/fix-parse-currency-not-covering-all-currencies
Open

Fix bug introduced by PR#167 not covering all available currencies#181
thai-truong wants to merge 1 commit intoRubyMoney:mainfrom
thai-truong:feature/fix-parse-currency-not-covering-all-currencies

Conversation

@thai-truong
Copy link

@thai-truong thai-truong commented Jun 6, 2024

Currently, there is an existing bug in monetize v1.13.0 introduced by #167 that attempted to implement additional logic for currency parsing discussed in #153.

Example of the bug:

  • Expected:
"RM100".to_money    # #<Money fractional:10000 currency:MYR>
Monetize.parse("RM100")   # #<Money fractional:10000 currency:MYR>
Monetize.parse("100 RM")   # #<Money fractional:10000 currency:MYR>
  • Reality:
[1] pry(main)> Monetize.parse("RM100")
=> #<Money fractional:10000 currency:USD>

[8] pry(main)> "RM100".to_money
=> #<Money fractional:10000 currency:USD>

[14] pry(main)> Monetize.parse("100 RM")
=> #<Money fractional:10000 currency:USD>

This PR aims to:

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants